package com.shrct.businessprocess.product.impl;

import com.shrct.businessprocess.product.RCProductType;
import com.shrct.businessprocess.product.proxy.RCProductTypeProxy;
import edu.fudan.langlab.domain.code.impl.CodeImpl;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("RCPRODUCTTYPE_TYPE")
public class RCProductTypeImpl extends CodeImpl implements RCProductType {
  public RCProductTypeImpl() {
    super();
  }
  
  public static RCProductType create(final IObjectFactory objectFactory) {
    com.shrct.businessprocess.product.RCProductType rCProductType = new com.shrct.businessprocess.product.impl.RCProductTypeImpl(
    );
    objectFactory.create(rCProductType);
    return rCProductType;			
    
  }
  
  public static RCProductType createRCProductTypeImpl(final IObjectFactory objectFactory, final Procedure1<RCProductType> init) {
    com.shrct.businessprocess.product.RCProductType rCProductType = new com.shrct.businessprocess.product.impl.RCProductTypeImpl(
    );
    objectFactory.create(rCProductType);
    init.apply(rCProductType);
    
    return rCProductType;			
    
  }
  
  public RCProductTypeProxy toProxy() {
    com.shrct.businessprocess.product.proxy.RCProductTypeProxy proxy = new com.shrct.businessprocess.product.proxy.RCProductTypeProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
